package nancal.mp.config

import nbcp.base.event.HttpRequestEvent
import nbcp.base.model.HttpInvoke
import nbcp.http.event.HttpClientGatewayHostEvent
import org.springframework.context.annotation.Configuration
import org.springframework.context.event.EventListener

@Configuration
class HttpClientHostConfig {

    @EventListener
    fun hostListener(ev: HttpClientGatewayHostEvent) {
        ev.requestHost = "//" + ev.request.name + "-java"
    }


    @EventListener
    fun requestEvent(ev: HttpRequestEvent) {
        HttpInvoke.lastRequest = ev.request
    }
}
